package com.czr.pug.controller;

import com.czr.orm.pug.mapper.KssUsersMapper;
import com.czr.pug.pojo.KssUsers;
import com.czr.pug.pojo.SysRole;
import com.czr.pug.service.user.KssUserService;
import com.pug.commons.anno.PugRateLimiter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Description:
 * Author: czr
 * Version: 1.0
 * Create Date Time: 2022/1/14 21:07.
 */
@RestController
public class IndexController {
    
    @Autowired
    private KssUserService kssUserService;


    @GetMapping("/index")
    @PugRateLimiter(limit = 3, timeout = 5)
    public String index() {
        return "hello springboot";
    }

    @GetMapping("/userlist")
    public List<KssUsers> userlist() {
        return kssUserService.list();
    }

}
